import request from '@/utils/request'
import { loginFrom, loginResponseData, userInfoResponseData } from './type'

enum LOGIN_API {
  LOGIN_URL = '/user/login',
  USERINFO_URL = '/user/info',
}

// 用户登录接口方法
export const user_login = (data: loginFrom) =>
  request.post<any, loginResponseData>(LOGIN_API.LOGIN_URL, data)

// 获取用户信息接口方法
export const get_user_info = () =>
  request.post<any, userInfoResponseData>(LOGIN_API.USERINFO_URL)
